﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8" />
    <title>TrafficLight: TrafficLight Class Reference</title>
    <link href="/Content/Help.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/tabs.css" rel="stylesheet" type="text/css" />
    <link href="/Content/css/doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
    <div id="header">
        <img id="logo" alt="StateForge" src="/Content/Images/StateForgeLogo.png" />
        <div id="title">
            <h1>
                Examples using state machines generated by StateBuilderCpp
            </h1>
            <h3>
                TrafficLight: TrafficLight Class Reference
            </h3>
        </div>
        <div id="menucontainer">
            <ul id="menu">
                <li><a href="/">Home</a></li>
                <li><a href="/Home/Download">Downloads</a></li>
                <li><a href="/Help/state-machine-tools.aspx">Help</a></li>
                <li><a href="/Home/Faq">F.A.Q</a></li>
                <li><a href="/Home/About">Contact us</a></li>
            </ul>
        </div>
    </div>
<!-- Generated by Doxygen 1.7.4 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-slots">Public Slots</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pri-slots">Private Slots</a> &#124;
<a href="#pri-methods">Private Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a>  </div>
  <div class="headertitle">
<div class="title">TrafficLight Class Reference</div>  </div>
</div>
<div class="contents">
<!-- doxytag: class="TrafficLight" -->
<p><code>#include &lt;<a class="el" href="_traffic_light_8h_source.html">TrafficLight.h</a>&gt;</code></p>

<p><a href="class_traffic_light-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-slots"></a>
Public Slots</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_traffic_light.html#ad219584a7c9722fae59e6eed4a25e65a">start</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_traffic_light.html#a28e72db41dcbd224a0a811d08ae20c3f">TrafficLight</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_traffic_light.html#a3dd2a89a028c1586ced0ab587dda8cc1">~TrafficLight</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pri-slots"></a>
Private Slots</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_traffic_light.html#a91703679fdf5a594ce160d56dc5b7263">contextEnd</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pri-methods"></a>
Private Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_traffic_light.html#ac3cbe5d786e50c5c92c932bfe4a56d06">logInit</a> ()</td></tr>
<tr><td colspan="2"><h2><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">TrafficLightContext *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_traffic_light.html#a0128c10cceb2d6bbcbda6db2d56ebb2b">m_pTrafficLightContext</a></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_light.html">Light</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_traffic_light.html#ace6d2dd89143fe31a81a37e6a7aca254">m_pLight</a></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock">
<p>Definition at line <a class="el" href="_traffic_light_8h_source.html#l00009">9</a> of file <a class="el" href="_traffic_light_8h_source.html">TrafficLight.h</a>.</p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a28e72db41dcbd224a0a811d08ae20c3f"></a><!-- doxytag: member="TrafficLight::TrafficLight" ref="a28e72db41dcbd224a0a811d08ae20c3f" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TrafficLight::TrafficLight </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cpp_source.html#l00018">18</a> of file <a class="el" href="_traffic_light_8cpp_source.html">TrafficLight.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
    <a class="code" href="class_traffic_light.html#ac3cbe5d786e50c5c92c932bfe4a56d06">logInit</a>();
    <a class="code" href="class_traffic_light.html#ace6d2dd89143fe31a81a37e6a7aca254">m_pLight</a> = <span class="keyword">new</span> <a class="code" href="class_light.html">Light</a>();
    <span class="comment">// Generated TrafficLightContext</span>
    <a class="code" href="class_traffic_light.html#a0128c10cceb2d6bbcbda6db2d56ebb2b">m_pTrafficLightContext</a> = <span class="keyword">new</span> TrafficLightContext(*<a class="code" href="class_traffic_light.html#ace6d2dd89143fe31a81a37e6a7aca254">m_pLight</a>, <span class="keyword">this</span>);
    <a class="code" href="class_traffic_light.html#a0128c10cceb2d6bbcbda6db2d56ebb2b">m_pTrafficLightContext</a>-&gt;SetObserver(SmQtObserver::GetInstance());
    QObject::connect(<a class="code" href="class_traffic_light.html#a0128c10cceb2d6bbcbda6db2d56ebb2b">m_pTrafficLightContext</a>,
                     SIGNAL(end()),
                     <span class="keyword">this</span>,
                     SLOT(<a class="code" href="class_traffic_light.html#a91703679fdf5a594ce160d56dc5b7263">contextEnd</a>()));
}
</pre></div>
</div>
</div>
<a class="anchor" id="a3dd2a89a028c1586ced0ab587dda8cc1"></a><!-- doxytag: member="TrafficLight::~TrafficLight" ref="a3dd2a89a028c1586ced0ab587dda8cc1" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TrafficLight::~TrafficLight </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [virtual]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cpp_source.html#l00031">31</a> of file <a class="el" href="_traffic_light_8cpp_source.html">TrafficLight.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
    <span class="keyword">delete</span> <a class="code" href="class_traffic_light.html#ace6d2dd89143fe31a81a37e6a7aca254">m_pLight</a>;
}
</pre></div>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a91703679fdf5a594ce160d56dc5b7263"></a><!-- doxytag: member="TrafficLight::contextEnd" ref="a91703679fdf5a594ce160d56dc5b7263" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TrafficLight::contextEnd </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private, slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cpp_source.html#l00051">51</a> of file <a class="el" href="_traffic_light_8cpp_source.html">TrafficLight.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
    QCoreApplication::exit(0);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ac3cbe5d786e50c5c92c932bfe4a56d06"></a><!-- doxytag: member="TrafficLight::logInit" ref="ac3cbe5d786e50c5c92c932bfe4a56d06" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TrafficLight::logInit </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cpp_source.html#l00036">36</a> of file <a class="el" href="_traffic_light_8cpp_source.html">TrafficLight.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
   QCoreApplication *pApp = QCoreApplication::instance();
   QsLogging::Logger&amp; logger = QsLogging::Logger::instance();
   logger.setLoggingLevel(QsLogging::TraceLevel);
   <span class="comment">//Log to file</span>
   <span class="keyword">const</span> QString logPath(QDir(pApp-&gt;applicationDirPath()).filePath(<span class="stringliteral">&quot;Log.txt&quot;</span>));
   QsLogging::DestinationPtr fileDestination(
      QsLogging::DestinationFactory::MakeFileDestination(logPath) );
   logger.addDestination(fileDestination);
   <span class="comment">//Log to standard output</span>
   QsLogging::DestinationPtr debugDestination = QsLogging::DestinationFactory::MakeDebugOutputDestination();
   logger.addDestination(debugDestination);
}
</pre></div>
</div>
</div>
<a class="anchor" id="ad219584a7c9722fae59e6eed4a25e65a"></a><!-- doxytag: member="TrafficLight::start" ref="ad219584a7c9722fae59e6eed4a25e65a" args="()" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void TrafficLight::start </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td><code> [slot]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8cpp_source.html#l00056">56</a> of file <a class="el" href="_traffic_light_8cpp_source.html">TrafficLight.cpp</a>.</p>
<div class="fragment"><pre class="fragment">{
    QLOG_INFO();
    <a class="code" href="class_traffic_light.html#a0128c10cceb2d6bbcbda6db2d56ebb2b">m_pTrafficLightContext</a>-&gt;EnterInitialState();
}
</pre></div>
</div>
</div>
<hr/><h2>Member Data Documentation</h2>
<a class="anchor" id="ace6d2dd89143fe31a81a37e6a7aca254"></a><!-- doxytag: member="TrafficLight::m_pLight" ref="ace6d2dd89143fe31a81a37e6a7aca254" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_light.html">Light</a>* <a class="el" href="class_traffic_light.html#ace6d2dd89143fe31a81a37e6a7aca254">TrafficLight::m_pLight</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8h_source.html#l00025">25</a> of file <a class="el" href="_traffic_light_8h_source.html">TrafficLight.h</a>.</p>

</div>
</div>
<a class="anchor" id="a0128c10cceb2d6bbcbda6db2d56ebb2b"></a><!-- doxytag: member="TrafficLight::m_pTrafficLightContext" ref="a0128c10cceb2d6bbcbda6db2d56ebb2b" args="" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">TrafficLightContext* <a class="el" href="class_traffic_light.html#a0128c10cceb2d6bbcbda6db2d56ebb2b">TrafficLight::m_pTrafficLightContext</a><code> [private]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Definition at line <a class="el" href="_traffic_light_8h_source.html#l00024">24</a> of file <a class="el" href="_traffic_light_8h_source.html">TrafficLight.h</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li><a class="el" href="_traffic_light_8h_source.html">TrafficLight.h</a></li>
<li><a class="el" href="_traffic_light_8cpp_source.html">TrafficLight.cpp</a></li>
</ul>
</div>
﻿<div id="footer">
    <hr />
    <p>
        Copyright &copy; 2011 StateForge.</p>
    <hr />
</div>
</body> </html> 
